-
-
Notifications
You must be signed in to change notification settings - Fork 699
Add links to and from deployments #1921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Caution Review failedThe pull request is closed. WalkthroughThis pull request adds a new method to calculate the deployment page based on a provided version. The Changes
Possibly related PRs
Suggested reviewers
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts (1)
171-218
: Well-implemented pagination logic for finding deployments by versionThe new
findPageForVersion
method provides a clean way to determine which page contains a specific deployment version. The SQL query efficiently compares version strings as integer arrays, which is appropriate for semantic versioning.There's a minor type issue in the SQL query return type. Consider using lowercase primitive types for consistency:
- const deploymentsSinceVersion = await this.#prismaClient.$queryRaw<{ count: BigInt }[]>` + const deploymentsSinceVersion = await this.#prismaClient.$queryRaw<{ count: bigint }[]>`🧰 Tools
🪛 Biome (1.9.4)
[error] 208-208: Don't use 'BigInt' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'bigint' instead(lint/complexity/noBannedTypes)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx (2)
74-95
: Consider improving error handling for version-based page findingThe logic to find a page based on version is well-implemented, but if an error occurs during the process, the code only logs to the console and then continues execution with the default page.
Consider adding a more user-friendly fallback, such as:
- } catch (error) { - console.error("Error finding page for version", error); - // Carry on, we'll just show the selected page - } + } catch (error) { + console.error("Error finding page for version", error); + // Return to first page as fallback + page = 1; + }
130-141
: Well-implemented automatic navigation to deployment detailsThe useEffect hook properly handles the use case of navigating to the selected deployment when a version parameter is provided. It correctly:
- Checks if there's a selected deployment but no deployment parameter
- Removes the version parameter from the URL
- Updates the URL with the deployment shortCode
Consider adding a dependency on
navigate
to the dependency array to silence any potential React hooks exhaustive-deps warnings:- }, [selectedDeployment, deploymentParam, location.search]); + }, [selectedDeployment, deploymentParam, location.search, navigate, location.pathname, currentPage]);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
(1 hunks)apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
(2 hunks)apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
(5 hunks)apps/webapp/app/routes/projects.v3.$projectRef.deployments.$deploymentParam.ts
(1 hunks)apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
(2 hunks)apps/webapp/app/utils/pathBuilder.ts
(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
[error] 208-208: Don't use 'BigInt' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'bigint' instead
(lint/complexity/noBannedTypes)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
- GitHub Check: units / 🧪 Unit Tests
- GitHub Check: typecheck / typecheck
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (11)
apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx (2)
60-63
: Good addition of the v3DeploymentVersionPath importThis import supports the new feature for navigating from a run to its corresponding deployment version.
531-546
: Well-implemented version navigation with tooltipThis change replaces the plain text version display with a clickable link that navigates to the deployment. The tooltip clearly communicates the action to users.
apps/webapp/app/routes/projects.v3.$projectRef.deployments.$deploymentParam.ts (1)
36-36
: Correct comment updateThe comment now accurately reflects that the redirection is to the project's deployments page, which aligns with the actual behavior of the code.
apps/webapp/app/utils/pathBuilder.ts (1)
398-405
: Good implementation of the deployment version path builderThe new function properly constructs a URL to the deployments page with the version as a query parameter, following the same pattern as other path builder functions in this file.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx (2)
31-31
: Good addition of v3RunsPath importThis import supports the new feature to make tasks in the deployment details clickable.
234-247
: Well-implemented clickable task rowsThis change makes tasks in the deployment panel clickable by:
- Creating a path to the runs filtered by task
- Adding the
to
prop to both cells in the rowUsers can now easily navigate from deployments to related runs filtered by task, improving the application's navigation experience.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx (5)
2-2
: Added required imports for new navigation functionalityThe import additions are necessary for the new deployment link navigation functionality.
55-55
: Added useEffect import for deployment navigationThis import is correctly added to support the new automatic navigation to deployment details.
65-68
: Added version parameter to search params schemaThe schema correctly defines the optional version parameter which enables linking directly to specific deployments.
106-111
: Good implementation of selectedDeployment findingThe code correctly identifies the deployment corresponding to the requested version, making it available to the UI component.
125-126
: Updated loader data destructuring to include selectedDeploymentCorrectly extracts the new selectedDeployment property from the loader data.
|
* link from deployments tasks to filtered runs view * jump to deployment * don't add version links for dev (yet)
* WIP on secret env vars * Editing individual env var values is working * Sort the env vars by the key * Deleting values * Allowing setting secret env vars * Added medium switch style * Many style changes to the env var form * “Copy text” -> “Copy” * Draw a divider between hidden buttons * Env var tweaks * Don’t show Dev:you anymore * Grouping the same env var keys together * Styles improved * Improved styling of edit panel * Fix bun detection, dev flushing, and init command (#1914) * update nypm to support text-based bun lockfiles * add nypm changeset * handle dev flushing failures gracefully * fix path normalization for init.ts * add changesets * chore: remove pre.json after exiting pre mode * init command to install v4-beta packages * Revert "chore: remove pre.json after exiting pre mode" This reverts commit f5694fd. * make init default to cli version for all packages * Release 4.0.0-v4-beta.1 (#1916) * chore: Update version for release (v4-beta) * Release 4.0.0-v4-beta.1 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com> * Both run engines will only lock to versions they can handle (#1922) * run engine v1 will only lock to v1 deployments * run engine v2 will only lock to managed v2 deployments * test: create background worker and deployment with correct engine version * Add links to and from deployments (#1921) * link from deployments tasks to filtered runs view * jump to deployment * don't add version links for dev (yet) * Fix current worker deployment getter (#1924) * only return last v1 deployment in the shared queue consumer * be explicit about only returning managed deployments * Add a docs page for the human-in-the-loop example project (#1919) * Add a docs page for the human-in-the-loop example project * Order guides, example projects and example tasks alphabetically in the docs list * Managed run controller revamp (#1927) * update nypm to support text-based bun lockfiles * fix retry spans * only download debug logs if admin * add nypm changeset * pull out env override logic * use runner env gather helper * handle dev flushing failures gracefully * fix path normalization for init.ts * add logger * add execution heartbeat service * add snapshot poller service * fix poller * add changesets * create socket in constructor * enable strictPropertyInitialization * deprecate dequeue from version * start is not async * dependency injection in prep for tests * add warm start count to all controller logs * add restore count * pull out run execution logic * temp disable pre * add a controller log when starting an execution * refactor execution and squash some bugs * cleanup completed docker containers by default * execution fixes and logging improvements * don't throw afet abort cleanup * poller should use private interval * rename heartbeat service file * rename HeartbeatService to IntervalService * restore old heartbeat service but deprecate it * use the new interval service everywhere * Revert "temp disable pre" This reverts commit e03f417. * add changeset * replace all run engine find uniques with find first * Release 4.0.0-v4-beta.2 (#1928) * chore: Update version for release (v4-beta) * Release 4.0.0-v4-beta.2 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com> * Remove batch ID carryover for non-batch waits (#1930) * add failing test case * do not carry over previous batch id when blocking with waitpoint * delete irrelevant test * Delete project (#1913) * Delete project - Don’t schedule tasks if the project is deleted - Delete queues from the master queues - Add the old delete project UI back in * Mark the project as deleted last * Fix for overriding local variable * Added a todo for deleting env queues * Remove todo * Improve usage flushing (#1931) * add flush to global usage api * enable controller debug logs * initialize usage manager after env overrides * add previous run id to more debug logs * add changeset * For secret env vars, don’t return the value * Added a new env var repository function for getting secrets with redactions * Test task for env vars * Delete heartbeat file, merge mess up --------- Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Saadi Myftija <saadi.myftija@gmail.com>
You can now click on tasks in the Deployments side panel, which will take you to the Runs page filtered by the task name:

The Detail tab on a run now also has a link back to the specific deployment:

Summary by CodeRabbit